# -*- coding: utf-8 -*-
from google.appengine.ext import db

from gaeo.controller import BaseController

import tweepy
import yaml
import logging

class TwitterController(BaseController):
    config = None
    def init(self):
        self.config = yaml.load(open('config.yaml'))
        basic_auth = tweepy.BasicAuthHandler(username=self.config["username"],
                                             password=self.config["password"])

        # should be set in config.yaml
        logging.getLogger().setLevel(logging.DEBUG)
        logging.info("init")
        api = tweepy.API(basic_auth)
        logging.info(api.rate_limit_status())
        return api
